package com.sc.controller.csm;

import com.sc.dto.PatrolBusinessDTO;
import com.sc.result.PageResult;
import com.sc.result.Result;
import com.sc.service.csm.PatrolBusinessService;
import com.sc.vo.PatrolBusinessVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/patrolBusiness")
@Api(tags = "巡更巡检业务管理接口")
@RequiredArgsConstructor
public class PatrolBusinessController {

    private final PatrolBusinessService patrolBusinessService;

    @ApiOperation("统计业务")
    @PostMapping("/statistics")
    public Result<PageResult<PatrolBusinessVO>> statistics(@RequestBody PatrolBusinessDTO patrolBusinessDTO) {
        return Result.success(patrolBusinessService.statistics(patrolBusinessDTO));
    }
}
